import { Injectable } from '@angular/core';
import { BehaviorSubject, Subject } from 'rxjs';

@Injectable({
  providedIn: 'root',
})
export class UserDetailComponentService {
  private new$ = new Subject();
  private view$ = new BehaviorSubject(null);

  public get OnNew() {
    return this.new$.asObservable();
  }

  public new() {
    this.new$.next(null);
  }

  public get OnView() {
    return this.view$.asObservable();
  }

  public view(model) {
    this.view$.next(model);
  }
}
